<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Faiss: faiss::gpu::IVFBase Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Faiss
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacefaiss.html">faiss</a></li><li class="navelem"><b>gpu</b></li><li class="navelem"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html">IVFBase</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="classfaiss_1_1gpu_1_1IVFBase-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">faiss::gpu::IVFBase Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Base inverted list functionality for <a class="el" href="classfaiss_1_1gpu_1_1IVFFlat.html">IVFFlat</a> and <a class="el" href="classfaiss_1_1gpu_1_1IVFPQ.html" title="Implementing class for IVFPQ on the GPU. ">IVFPQ</a>.  
 <a href="classfaiss_1_1gpu_1_1IVFBase.html#details">More...</a></p>
<div class="dynheader">
Inheritance diagram for faiss::gpu::IVFBase:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classfaiss_1_1gpu_1_1IVFBase.png" usemap="#faiss::gpu::IVFBase_map" alt=""/>
  <map id="faiss::gpu::IVFBase_map" name="faiss::gpu::IVFBase_map">
<area href="classfaiss_1_1gpu_1_1IVFFlat.html" alt="faiss::gpu::IVFFlat" shape="rect" coords="0,56,119,80"/>
<area href="classfaiss_1_1gpu_1_1IVFPQ.html" title="Implementing class for IVFPQ on the GPU. " alt="faiss::gpu::IVFPQ" shape="rect" coords="129,56,248,80"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a80130acfe0a2a4d387a5c9ee4c386b9c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a80130acfe0a2a4d387a5c9ee4c386b9c">IVFBase</a> (<a class="el" href="classfaiss_1_1gpu_1_1GpuResources.html">GpuResources</a> *resources, <a class="el" href="classfaiss_1_1gpu_1_1FlatIndex.html">FlatIndex</a> *quantizer, int bytesPerVector, IndicesOptions indicesOptions, MemorySpace space)</td></tr>
<tr class="separator:a80130acfe0a2a4d387a5c9ee4c386b9c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a02e1e2d080ee31bf7835f89b9f2a13a9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a02e1e2d080ee31bf7835f89b9f2a13a9"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a02e1e2d080ee31bf7835f89b9f2a13a9">reserveMemory</a> (size_t numVecs)</td></tr>
<tr class="memdesc:a02e1e2d080ee31bf7835f89b9f2a13a9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reserve GPU memory in our inverted lists for this number of vectors. <br/></td></tr>
<tr class="separator:a02e1e2d080ee31bf7835f89b9f2a13a9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ea671876443c93436499ad581f16997"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a7ea671876443c93436499ad581f16997">reset</a> ()</td></tr>
<tr class="separator:a7ea671876443c93436499ad581f16997"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d44e8aebc380b7c846a8d8e6e835540"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4d44e8aebc380b7c846a8d8e6e835540"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a4d44e8aebc380b7c846a8d8e6e835540">getDim</a> () const </td></tr>
<tr class="memdesc:a4d44e8aebc380b7c846a8d8e6e835540"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the number of dimensions we are indexing. <br/></td></tr>
<tr class="separator:a4d44e8aebc380b7c846a8d8e6e835540"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac9b69e1b2582cb2c064b5fff60d31cc8"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#ac9b69e1b2582cb2c064b5fff60d31cc8">reclaimMemory</a> ()</td></tr>
<tr class="separator:ac9b69e1b2582cb2c064b5fff60d31cc8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abd66dc9d32e6150b930d78f74d7dd2d7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abd66dc9d32e6150b930d78f74d7dd2d7"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#abd66dc9d32e6150b930d78f74d7dd2d7">getNumLists</a> () const </td></tr>
<tr class="memdesc:abd66dc9d32e6150b930d78f74d7dd2d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of inverted lists. <br/></td></tr>
<tr class="separator:abd66dc9d32e6150b930d78f74d7dd2d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7b1ee21f9919fb077db5e48e91943582"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a7b1ee21f9919fb077db5e48e91943582">getListLength</a> (int listId) const </td></tr>
<tr class="separator:a7b1ee21f9919fb077db5e48e91943582"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4a4ed220b9433aa788ed32db8f20a9db"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4a4ed220b9433aa788ed32db8f20a9db"></a>
std::vector&lt; long &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a4a4ed220b9433aa788ed32db8f20a9db">getListIndices</a> (int listId) const </td></tr>
<tr class="memdesc:a4a4ed220b9433aa788ed32db8f20a9db"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the list indices of a particular list back to the CPU. <br/></td></tr>
<tr class="separator:a4a4ed220b9433aa788ed32db8f20a9db"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:aa02d69306544294521e79be7f81a21cb"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#aa02d69306544294521e79be7f81a21cb">reclaimMemory_</a> (bool exact)</td></tr>
<tr class="separator:aa02d69306544294521e79be7f81a21cb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acc695610c9513952b8d234dc0db78e5c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acc695610c9513952b8d234dc0db78e5c"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#acc695610c9513952b8d234dc0db78e5c">updateDeviceListInfo_</a> (cudaStream_t stream)</td></tr>
<tr class="memdesc:acc695610c9513952b8d234dc0db78e5c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Update all device-side list pointer and size information. <br/></td></tr>
<tr class="separator:acc695610c9513952b8d234dc0db78e5c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae90724e307bbfe49554a2ab77fbd1764"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#ae90724e307bbfe49554a2ab77fbd1764">updateDeviceListInfo_</a> (const std::vector&lt; int &gt; &amp;listIds, cudaStream_t stream)</td></tr>
<tr class="separator:ae90724e307bbfe49554a2ab77fbd1764"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5027720549de98f4e609d6339099df35"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5027720549de98f4e609d6339099df35"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a5027720549de98f4e609d6339099df35">addIndicesFromCpu_</a> (int listId, const long *indices, size_t numVecs)</td></tr>
<tr class="memdesc:a5027720549de98f4e609d6339099df35"><td class="mdescLeft">&#160;</td><td class="mdescRight">Shared function to copy indices from CPU to GPU. <br/></td></tr>
<tr class="separator:a5027720549de98f4e609d6339099df35"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:a05e6400358ec1f529a67209d3f24cc63"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a05e6400358ec1f529a67209d3f24cc63"></a>
<a class="el" href="classfaiss_1_1gpu_1_1GpuResources.html">GpuResources</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a05e6400358ec1f529a67209d3f24cc63">resources_</a></td></tr>
<tr class="memdesc:a05e6400358ec1f529a67209d3f24cc63"><td class="mdescLeft">&#160;</td><td class="mdescRight">Collection of GPU resources that we use. <br/></td></tr>
<tr class="separator:a05e6400358ec1f529a67209d3f24cc63"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a878114abdba07c9cf7735f9c0ed594c3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a878114abdba07c9cf7735f9c0ed594c3"></a>
<a class="el" href="classfaiss_1_1gpu_1_1FlatIndex.html">FlatIndex</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a878114abdba07c9cf7735f9c0ed594c3">quantizer_</a></td></tr>
<tr class="memdesc:a878114abdba07c9cf7735f9c0ed594c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Quantizer object. <br/></td></tr>
<tr class="separator:a878114abdba07c9cf7735f9c0ed594c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba3e3cfa469e5187f2d553fff10e0250"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aba3e3cfa469e5187f2d553fff10e0250"></a>
const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#aba3e3cfa469e5187f2d553fff10e0250">dim_</a></td></tr>
<tr class="memdesc:aba3e3cfa469e5187f2d553fff10e0250"><td class="mdescLeft">&#160;</td><td class="mdescRight">Expected dimensionality of the vectors. <br/></td></tr>
<tr class="separator:aba3e3cfa469e5187f2d553fff10e0250"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:accc4d96c14643e5f471220cb1e92ac70"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="accc4d96c14643e5f471220cb1e92ac70"></a>
const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#accc4d96c14643e5f471220cb1e92ac70">numLists_</a></td></tr>
<tr class="memdesc:accc4d96c14643e5f471220cb1e92ac70"><td class="mdescLeft">&#160;</td><td class="mdescRight">Number of inverted lists we maintain. <br/></td></tr>
<tr class="separator:accc4d96c14643e5f471220cb1e92ac70"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a319568b832518392fed33ea4f8bfc613"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a319568b832518392fed33ea4f8bfc613"></a>
const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a319568b832518392fed33ea4f8bfc613">bytesPerVector_</a></td></tr>
<tr class="memdesc:a319568b832518392fed33ea4f8bfc613"><td class="mdescLeft">&#160;</td><td class="mdescRight">Number of bytes per vector in the list. <br/></td></tr>
<tr class="separator:a319568b832518392fed33ea4f8bfc613"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afb6d10e23d6448c10f472b9234e0bcab"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afb6d10e23d6448c10f472b9234e0bcab"></a>
const IndicesOptions&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#afb6d10e23d6448c10f472b9234e0bcab">indicesOptions_</a></td></tr>
<tr class="memdesc:afb6d10e23d6448c10f472b9234e0bcab"><td class="mdescLeft">&#160;</td><td class="mdescRight">How are user indices stored on the GPU? <br/></td></tr>
<tr class="separator:afb6d10e23d6448c10f472b9234e0bcab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a30499eb61763df72cab25ea9d1235251"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a30499eb61763df72cab25ea9d1235251"></a>
const MemorySpace&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a30499eb61763df72cab25ea9d1235251">space_</a></td></tr>
<tr class="memdesc:a30499eb61763df72cab25ea9d1235251"><td class="mdescLeft">&#160;</td><td class="mdescRight">What memory space our inverted list storage is in. <br/></td></tr>
<tr class="separator:a30499eb61763df72cab25ea9d1235251"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a96240a08b42bd1913e2286d7d514fc56"><td class="memItemLeft" align="right" valign="top">thrust::device_vector&lt; void * &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a96240a08b42bd1913e2286d7d514fc56">deviceListDataPointers_</a></td></tr>
<tr class="separator:a96240a08b42bd1913e2286d7d514fc56"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9aedcf0e6a20b908980ae96d73461f4c"><td class="memItemLeft" align="right" valign="top">thrust::device_vector&lt; void * &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a9aedcf0e6a20b908980ae96d73461f4c">deviceListIndexPointers_</a></td></tr>
<tr class="separator:a9aedcf0e6a20b908980ae96d73461f4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3a1c2031a4763f7d55bc8a400c63af66"><td class="memItemLeft" align="right" valign="top">thrust::device_vector&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a3a1c2031a4763f7d55bc8a400c63af66">deviceListLengths_</a></td></tr>
<tr class="separator:a3a1c2031a4763f7d55bc8a400c63af66"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae25ea0901fb628844868413f51c85bda"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae25ea0901fb628844868413f51c85bda"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#ae25ea0901fb628844868413f51c85bda">maxListLength_</a></td></tr>
<tr class="memdesc:ae25ea0901fb628844868413f51c85bda"><td class="mdescLeft">&#160;</td><td class="mdescRight">Maximum list length seen. <br/></td></tr>
<tr class="separator:ae25ea0901fb628844868413f51c85bda"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2facc7285107de1f24d3471cbcf15f26"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::unique_ptr<br class="typebreak"/>
&lt; <a class="el" href="classfaiss_1_1gpu_1_1DeviceVector.html">DeviceVector</a>&lt; unsigned char &gt; &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a2facc7285107de1f24d3471cbcf15f26">deviceListData_</a></td></tr>
<tr class="separator:a2facc7285107de1f24d3471cbcf15f26"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2c364dbd74e459db976b7c3a8e3d9f1b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2c364dbd74e459db976b7c3a8e3d9f1b"></a>
std::vector&lt; std::unique_ptr<br class="typebreak"/>
&lt; <a class="el" href="classfaiss_1_1gpu_1_1DeviceVector.html">DeviceVector</a>&lt; unsigned char &gt; &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>deviceListIndices_</b></td></tr>
<tr class="separator:a2c364dbd74e459db976b7c3a8e3d9f1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a53f3c382a79b7f89630a85dfbc3a1fed"><td class="memItemLeft" align="right" valign="top">std::vector&lt; std::vector&lt; long &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1IVFBase.html#a53f3c382a79b7f89630a85dfbc3a1fed">listOffsetToUserIndex_</a></td></tr>
<tr class="separator:a53f3c382a79b7f89630a85dfbc3a1fed"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Base inverted list functionality for <a class="el" href="classfaiss_1_1gpu_1_1IVFFlat.html">IVFFlat</a> and <a class="el" href="classfaiss_1_1gpu_1_1IVFPQ.html" title="Implementing class for IVFPQ on the GPU. ">IVFPQ</a>. </p>

<p>Definition at line <a class="el" href="IVFBase_8cuh_source.html#l00025">25</a> of file <a class="el" href="IVFBase_8cuh_source.html">IVFBase.cuh</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a80130acfe0a2a4d387a5c9ee4c386b9c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">faiss::gpu::IVFBase::IVFBase </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classfaiss_1_1gpu_1_1GpuResources.html">GpuResources</a> *&#160;</td>
          <td class="paramname"><em>resources</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classfaiss_1_1gpu_1_1FlatIndex.html">FlatIndex</a> *&#160;</td>
          <td class="paramname"><em>quantizer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>bytesPerVector</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">IndicesOptions&#160;</td>
          <td class="paramname"><em>indicesOptions</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">MemorySpace&#160;</td>
          <td class="paramname"><em>space</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">quantizer</td><td>We do not own this reference </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="IVFBase_8cu_source.html#l00023">23</a> of file <a class="el" href="IVFBase_8cu_source.html">IVFBase.cu</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a7b1ee21f9919fb077db5e48e91943582"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int faiss::gpu::IVFBase::getListLength </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>listId</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>For debugging purposes, return the list length of a particular list </p>

<p>Definition at line <a class="el" href="IVFBase_8cu_source.html#l00198">198</a> of file <a class="el" href="IVFBase_8cu_source.html">IVFBase.cu</a>.</p>

</div>
</div>
<a class="anchor" id="ac9b69e1b2582cb2c064b5fff60d31cc8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t faiss::gpu::IVFBase::reclaimMemory </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>After adding vectors, one can call this to reclaim device memory to exactly the amount needed. Returns space reclaimed in bytes </p>

<p>Definition at line <a class="el" href="IVFBase_8cu_source.html#l00103">103</a> of file <a class="el" href="IVFBase_8cu_source.html">IVFBase.cu</a>.</p>

</div>
</div>
<a class="anchor" id="aa02d69306544294521e79be7f81a21cb"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">size_t faiss::gpu::IVFBase::reclaimMemory_ </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>exact</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Reclaim memory consumed on the device for our inverted lists <code>exact</code> means we trim exactly to the memory needed </p>

<p>Definition at line <a class="el" href="IVFBase_8cu_source.html#l00109">109</a> of file <a class="el" href="IVFBase_8cu_source.html">IVFBase.cu</a>.</p>

</div>
</div>
<a class="anchor" id="a7ea671876443c93436499ad581f16997"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void faiss::gpu::IVFBase::reset </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Clear out all inverted lists, but retain the coarse quantizer and the product quantizer info </p>

<p>Definition at line <a class="el" href="IVFBase_8cu_source.html#l00073">73</a> of file <a class="el" href="IVFBase_8cu_source.html">IVFBase.cu</a>.</p>

</div>
</div>
<a class="anchor" id="ae90724e307bbfe49554a2ab77fbd1764"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void faiss::gpu::IVFBase::updateDeviceListInfo_ </td>
          <td>(</td>
          <td class="paramtype">const std::vector&lt; int &gt; &amp;&#160;</td>
          <td class="paramname"><em>listIds</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">cudaStream_t&#160;</td>
          <td class="paramname"><em>stream</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>For a set of list IDs, update device-side list pointer and size information </p>

<p>Definition at line <a class="el" href="IVFBase_8cu_source.html#l00146">146</a> of file <a class="el" href="IVFBase_8cu_source.html">IVFBase.cu</a>.</p>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="a2facc7285107de1f24d3471cbcf15f26"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::vector&lt;std::unique_ptr&lt;<a class="el" href="classfaiss_1_1gpu_1_1DeviceVector.html">DeviceVector</a>&lt;unsigned char&gt; &gt; &gt; faiss::gpu::IVFBase::deviceListData_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Device memory for each separate list, as managed by the host. Device memory as stored in <a class="el" href="classfaiss_1_1gpu_1_1DeviceVector.html">DeviceVector</a> is stored as unique_ptr since deviceListSummary_ pointers must remain valid despite resizing of deviceLists_ </p>

<p>Definition at line <a class="el" href="IVFBase_8cuh_source.html#l00119">119</a> of file <a class="el" href="IVFBase_8cuh_source.html">IVFBase.cuh</a>.</p>

</div>
</div>
<a class="anchor" id="a96240a08b42bd1913e2286d7d514fc56"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">thrust::device_vector&lt;void*&gt; faiss::gpu::IVFBase::deviceListDataPointers_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Device representation of all inverted list data id -&gt; data </p>

<p>Definition at line <a class="el" href="IVFBase_8cuh_source.html#l00102">102</a> of file <a class="el" href="IVFBase_8cuh_source.html">IVFBase.cuh</a>.</p>

</div>
</div>
<a class="anchor" id="a9aedcf0e6a20b908980ae96d73461f4c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">thrust::device_vector&lt;void*&gt; faiss::gpu::IVFBase::deviceListIndexPointers_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Device representation of all inverted list index pointers id -&gt; data </p>

<p>Definition at line <a class="el" href="IVFBase_8cuh_source.html#l00106">106</a> of file <a class="el" href="IVFBase_8cuh_source.html">IVFBase.cuh</a>.</p>

</div>
</div>
<a class="anchor" id="a3a1c2031a4763f7d55bc8a400c63af66"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">thrust::device_vector&lt;int&gt; faiss::gpu::IVFBase::deviceListLengths_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Device representation of all inverted list lengths id -&gt; length </p>

<p>Definition at line <a class="el" href="IVFBase_8cuh_source.html#l00110">110</a> of file <a class="el" href="IVFBase_8cuh_source.html">IVFBase.cuh</a>.</p>

</div>
</div>
<a class="anchor" id="a53f3c382a79b7f89630a85dfbc3a1fed"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::vector&lt;std::vector&lt;long&gt; &gt; faiss::gpu::IVFBase::listOffsetToUserIndex_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>If we are storing indices on the CPU (indicesOptions_ is INDICES_CPU), then this maintains a CPU-side map of what (inverted list id, offset) maps to which user index </p>

<p>Definition at line <a class="el" href="IVFBase_8cuh_source.html#l00125">125</a> of file <a class="el" href="IVFBase_8cuh_source.html">IVFBase.cuh</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/data/users/hoss/faiss/gpu/impl/<a class="el" href="IVFBase_8cuh_source.html">IVFBase.cuh</a></li>
<li>/data/users/hoss/faiss/gpu/impl/<a class="el" href="IVFBase_8cu_source.html">IVFBase.cu</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
